﻿using System.Web.Mvc;

namespace Omu.Awesome.Mvc
{
    [WhiteSpaceFilter]
    public class LookupController : Controller
    {
        public virtual ActionResult SearchForm()
        {
            return View(Settings.AwesomeFolder + "SearchForm.ascx");
        }

        public virtual ActionResult Header()
        {
            return Content(string.Empty);
        }

        public virtual ActionResult Index(string prop, string[] datak, string[] datav, string[] park, string[] parv, bool multi, bool paging = false)
        {
            ViewData["prop"] = prop;
            ViewData["paging"] = paging;
            ViewData["datak"] = datak;
            ViewData["datav"] = datav;
            ViewData["park"] = park;
            ViewData["parv"] = parv;
            ViewData["moreText"] = Settings.GetText != null ? Settings.GetText("Lookup", "More"): "more";
            return View(Settings.AwesomeFolder + (multi ? "MultiLookupPopup.ascx" : "LookupPopup.ascx"));
        }
    }
}